This repository was archived by the owner on Dec 17, 2025. It is now read-only.
feat: add ability to define original image id and image name used in custom images #1978
Open
aminfa wants to merge 3 commits intocontainrrr:mainfrom
Open
feat: add ability to define original image id and image name used in custom images #1978aminfa wants to merge 3 commits intocontainrrr:mainfrom
aminfa wants to merge 3 commits intocontainrrr:mainfrom
Conversation
…image id and name
|
+1, this is a helpful feature for myself, and others who are using watchtower for monitoring only, and have custom local built images. One very useful addition would be the possibility to have the ID of the base image optional. I dont really know if its a workable approach, but would perfectly fit my use case, when using fixed version tags in the base images, not rolling ones. In this case watchtower should gather the ID for the base image found in com.centurylinklabs.watchtower.original-image label. This way the addition of the base image is straightforward in the local build context like this: docker-compose.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR: This PR allows one to add two labels to containers that define which original image was used as the base of the image being run.
The problem
Sometimes it is necessary to build a custom docker image that only slightly changes a base image. For example:
When running this custom image, watchtower cannot figure out that the base nginx image is stale, as it instead only checks if our custom nginx image is stale:
The solution
With this PR, it is possible to add two labels to the container that overwrites the image ID and image name used by watchtower to decide whether the image is stale:
Now, watchtower reports a new nginx version:
Current limitations
Currently automatic updating of the images will break the containers as it will replace the container using images of the original base image. Here it would start
nginx:1.25.5instead of a custom version of it.Thus, it is necessary to set
monitor-only=1.Further work
I haven't done: "Tests that verify the code your contributing" and "Updates to the documentation" because I wanted to wait and see if this feature is even desired.
Feel free to reject the PR if the feature does not fit within the scope of this project.